package fr.ajicommerce;

import java.io.Serializable;

import javax.faces.context.FacesContext;

import org.springframework.beans.factory.annotation.Autowired;


public class FrontOffice implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 5827140372106270816L;
	
	@Autowired
	private PanierSession panier;

	
	
	
	public PanierSession getPanier() {
		
		FacesContext context = FacesContext.getCurrentInstance();
		PanierSession panierTmp = (PanierSession) context.getExternalContext().getSessionMap().get("panier");
		if(panierTmp == null)
			context.getExternalContext().getSessionMap().put("panier", panier);
		
		return panier;
	}

	public void setPanier(PanierSession panier) {
		this.panier = panier;
		FacesContext context = FacesContext.getCurrentInstance();
		context.getExternalContext().getSessionMap().put("panier", panier);
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	
	
	
	
}
